package com.yy.glide.load;

import android.net.Uri;

import com.yy.glide.load.data.HttpUrlFetcher;

import java.io.InputStream;
import java.net.URI;

public class HttpUrlLoader implements ModelLoader<Uri, InputStream> {
    @Override
    public boolean handle(Uri uri) {
        String scheme = uri.getScheme();

        return scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https");
    }

    @Override
    public LoadData<InputStream> buildData(Uri uri) {
        return new LoadData<InputStream>(new ObjectKey(uri), new HttpUrlFetcher(uri));
    }
}
